package com.prik.factory.abs.store;

import com.prik.factory.abs.ingredient.PizzaIngredientFactory;
import com.prik.factory.abs.ingredient.shanghai.SHPizzaIngredientFactory;
import com.prik.factory.abs.pizza.CheesePizza;
import com.prik.factory.abs.pizza.Pizza;

/**
 * 上海加盟店
 **/
public class SHPizzaStore extends PizzaStore {

    /**
     * 上海披萨原料工厂
     */
    private PizzaIngredientFactory ingredientFactory = new SHPizzaIngredientFactory();

    private Pizza pizza;

    @Override
    protected Pizza createPizza(String type) {
        if ("cheese".equals(type)) {
            pizza = new CheesePizza(ingredientFactory);
            pizza.setName("上海芝士披萨");
            return pizza;
        } else if ("veggie".equals(type)) {
            // 略...
            return null;
        }
        return null;
    }
}